package com.jfsnpm.action;

import java.util.List;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.jfsnpm.common.AppSql;

public class PmMenu {
	/**
	 * 获得全部菜单列表
	 * @return List<Record>
	 */
	public static List<Record> getAllMenu(){
		return Db.find(AppSql.getsql("pm.PmMenuSelect"));
	}
	public static boolean deleteMenus(String[] ids){
		for(String deletemenuid:ids){
			if(!Db.deleteById("pm_menu", deletemenuid)) return false;
		}
		return true;
	}
	public static List<Record> getAllMenuWithAuth(String roleid){
		return Db.find(AppSql.getsql("pm.PmRelationMenuRoleWithAuth"),roleid);
	}
	
}
